package org.tulkas.http.headers;

/**
 * Some typical Content Types
 * 
 * @author <a href="mailto:tulkas.web@gmail.com">Tulkas</a>
 *
 */
public class MediaTypes {
	public static final MediaTypes TYPICAL = new MediaTypes();

	//text types
	public final String HTML = "text/html";
	public final String TEXT = "text/plain";
	public final String XML = "text/xml";

	//application types
	public final String XHTML = "application/xhtml+xml";
	public final String JSON = "application/json";
	public final String ATOM = "application/atom+xml";
	public final String FORM = "application/x-www-form-urlencoded";
	public final String FORM_DATA = "multipart/form-data";
	public final String FLASH = "application/x-shockwave-flash";
	public final String ARBITRARY_BINARY = "application/octet-stream";

	//image types
	public final String GIF = "image/gif";
	public final String JPEG = "image/jpeg";
	public final String PNG = "image/png";
	public final String SVG = "image/svg+xml";
	public final String TIFF = "image/tiff";
	public final String PJPEG = "image/pjpeg";

	public boolean isImage(final String contentType) {
		if (JPEG.equals(contentType) || GIF.equals(contentType)
				|| PNG.equals(contentType) || TIFF.equals(contentType)
				|| SVG.equals(contentType) || PJPEG.equals(contentType))
			return true;
		else
			return false;
	}
}
